﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace WebSite.Web.Models
{
    public class AdminUserVM
    {
        public int UserId { get; set; }
        public string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [DisplayName("旧密码")]
        //[StringLength(15, ErrorMessage = "旧密码的长度从6至15字符", MinimumLength = 6)]
        [Required(ErrorMessage = "旧密码不能为空")]
        public string Password { get; set; }
        public string TrueName { get; set; }
        public DateTime CreateDate { get; set; }
        public int UserState { get; set; }
        public int CompanyId { get; set; }
        /// <summary>
        /// 新密码
        /// </summary>
        [DisplayName("新密码")]
        [Required(ErrorMessage = "新密码不能为空")]
        [DataType(DataType.Password)]
        //[Compare("Password", ErrorMessage = "新密码和旧密码不能相同")]
        //[StringLength(15, ErrorMessage = "密新码的长度从6至15字符", MinimumLength = 6)]
        public string NewPass { get; set; }

        /// <summary>
        /// 确认密码
        /// </summary>
        [DisplayName("确认密码")]
        [Required(ErrorMessage = "密码不能为空")]
        [DataType(DataType.Password)]
        [Compare("NewPass", ErrorMessage = "新密码不一致")]
        //[StringLength(15, ErrorMessage = "密码的长度从6至15字符", MinimumLength = 6)]
        public string AgainPass { get; set; }
    }
}